//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ruoyi.live.standard.service;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

@Component
public class StandardServiceFactory implements ApplicationContextAware {
    private static Map<String, StandardService> standardServiceMap;

    public StandardServiceFactory() {
    }

    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        Map<String, StandardService> map = applicationContext.getBeansOfType(StandardService.class);
        standardServiceMap = new HashMap();
        Iterator var3 = map.keySet().iterator();

        while(var3.hasNext()) {
            String beanType = (String)var3.next();
            standardServiceMap.put(((StandardService)map.get(beanType)).getStandardCode(), map.get(beanType));
        }

    }

    public static StandardService getService(String code) {
        return (StandardService)standardServiceMap.get(code);
    }
}
